import { configureStore } from '@reduxjs/toolkit';
import userReducer from '../reducer/userReducer';
import safeAreaReducer from '../reducer/safeAreaReducer';

const store = configureStore({
    reducer: {
        // posts: postsReducer,
        // comments: commentsReducer,
        user: userReducer,
        safeArea: safeAreaReducer
    },
});

// 从 store 本身推断出 `RootState` 和 `AppDispatch` types
export type RootState = ReturnType<typeof store.getState>;
// 类型推断: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch;

export default store